<?php
/**
 * Created by PhpStorm.
 * User: admin
 * Date: 2019/10/31
 * Time: 11:24
 */

namespace app\adminapiv3\controller;




class ServerUpdateLog extends Base
{
    /**
     * @name 更新日志列表
     * @author wx
     * @date 2019/11/25 10:45
     */
    public function list()
    {
        $params['host_id'] = $this->filterInput('host_id*','get');
        $params['old_version'] = $this->filterInput('old_version','get');
        $params['new_version'] = $this->filterInput('new_version','get');
        $params['ip'] = $this->filterInput('ip','get');
        $params['type'] = $this->filterInput('type','get');
        $params['status'] = $this->filterInput('status','get');
        $params['desc'] = $this->filterInput('desc','get');
        $params['ctime'] = $this->filterInput('ctime','get');

        $server = new \app\adminapiv3\service\ServerUpdateLog();
        $list = $server->list($params, $this->getLimit());

        $this->jsonOutPut($list);
    }

    /**
     * @name 更新日志列表
     * @author wx
     * @date 2020/7/28 14:49
     */
    public function hostList()
    {
        $params['name'] = $this->filterInput('name','post');
        $params['client_version'] = $this->filterInput('client_version','post');
        $params['client_update_status'] = $this->filterInput('client_update_status','post');


        $server = new \app\adminapiv3\service\ServerUpdateLog();
        $list = $server->hostList($params, $this->getLimit());

        $this->jsonOutPut($list);
    }

    /**
     * @name 批量删除
     * @author wx
     * @date 2020/5/28 16:44
     */
    public function del()
    {
        global $logContent;
        $logContent = '批量删除更新日志';

        $id = $this->filterInput('id*', 'post');
        $server = new \app\adminapiv3\service\ServerUpdateLog();
        $server->del($id);

        $this->jsonOutPut();
    }

    /**
     * @name 清空日志
     * @author wx
     * @date 2020/5/28 16:44
     */
    public function clear()
    {
        global $logContent;
        $logContent = '清空更新日志';

        $server = new \app\adminapiv3\service\ServerUpdateLog();
        $server->clear();

        $this->jsonOutPut();
    }
}